Suggested Solution (1) #include #include /* to link mathematical functions */ main() { flaot a, b, c, X1, X2; printf("Please enter coefficients a, b, and c for the polynomial:\n"); scanf("%f%f%f", &a, &b, &c); if (a !=0) if (b*b >= 4*a*c) { X1 = (-b + sqrt(b*b - 4*a*c))/(2*a);/* First root */ X2 = (-b - sqrt(b*b - 4*a*c))/(2*a);/* Second root */ printf("When a = %4.2f, b = %4.2f, and c = %4.2f:\ x = %4.2f or %4.2f\n\n", a, b, c, X1, X2); else printf("No real solution,the square root has no real \ value.\n") else printf("Not an quadratic equation, the first coefficient entered is zero.\n"); ********************************************************************* (2) #include main() { int in1, in2, inS, inL; float ft1, ft2, ftS, ftL; printf("Please enter two integers and two real numbers:\n"); scanf("%d%d%f%f", &in1, &in2, &ft1, &ft2); /* enter data */ if (in1 >= in2) /* assign larger integer to inL */ {inL = in1; /* and smaller one to inS */ inS = in2; } else {inL = in2; inS = in1; } if (ft1 >= ft2) /* assign larger real to ftL */ {ftL = ft1; /* and smaller real to ftS */ ftS = ft2; } else {ftL = ft2; ftS = ft1; } if (inS >= ftL) /*even the smaller int >= the large float */ printf("Both integers are larger than or at least equal\ to both floats.\n"); else {if (inL >= ftL && inS >= ftS) /* but inS < ftL */ printf("The large integer is larger than the large float, and the small integer is larger than the small float.\n"); else {if (inL >= ftS) printf("At least one integer is larger than one float.\n"); else printf("Both integers are smaller than the floats.\n"); } } } ********************************************************************* (3) #include main() { int n, i, even_sum, odd_sum, start, end; printf("Please enter an integer:\n"); scanf("%d", &n); if (n >= 0) /* for non-negative n */ {start = n; end = 2*n; } else {start = 2*n; /* for negative n */ end = n; } for (i=start; i<=end; i++) { if ( (i%2) == 0 ) /* for even values */ even_sum += i; } i = start; while ( i <= end ) { if ( (i%2) != 0 ) /* for odd values */ odd_sum += i; i++; } printf("The sum for all even numbers between %d and %d is %d\n",\ start, end, even_sum); printf("The sum for all odd numbers between %d and %d is %d\n",\ start, end, odd_sum); }